package com.wangzhixuan.controller.admin;

import com.wangzhixuan.commons.base.BaseController;
import com.wangzhixuan.commons.result.PageInfo;
import com.wangzhixuan.commons.result.Result;
import com.wangzhixuan.model.SysLog;
import com.wangzhixuan.service.ISysLogService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description：日志管理
 * @author：zhixuan.wang
 * @date：2015/10/30 18:06
 */
@Api(tags = "7. 日志管理")
@RestController
@RequestMapping("/admin/sysLog")
public class SysLogController extends BaseController {
    @Autowired
    private ISysLogService sysLogService;

    @GetMapping("/dataGrid")
    public Result<PageInfo<SysLog>> dataGrid(Integer page, Integer rows,
                                             @RequestParam(value = "sort", defaultValue = "create_time") String sort,
                                             @RequestParam(value = "order", defaultValue = "DESC") String order) {
        PageInfo<SysLog> pageInfo = new PageInfo<>(page, rows, sort, order);
        sysLogService.selectDataGrid(pageInfo);
        return renderObj(pageInfo);
    }
}
